function OnClickGreetings()
{
              /* var msg='<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">'+
                '<S:Header/>'+
                '<S:Body>'+
                    '<ns2:getPic xmlns:ns2="http://WebServiceStub.com/"/>'+
                '</S:Body>'+
            '</S:Envelope>';
                $.ajax({
                url:"http://localhost:8080/WebServiceStub/WebServiceStub",
                type: "POST",
                dataType: "xml",
                data: msg,
                contentType: 'text/xml; charset="utf-8"',
                success:function(result){
                    OnSucsessHelloWorld(result);
                      //alert( $(result).find("return").text());
                },
                 error: function(){alert("Error: Something went wrong");}									 
                });*/
                alert("asd");

}

function OnSucsessHelloWorld(result){
    /*
    $(result).find("return").each(function () {
        
        $(".main").append('<div class="book"><div class="title">' + $(this).find("Title").text() + '</div><div class="description">' + $(this).find("Description").text() + '</div><div class="date">Published ' + $(this).find("Date").text() + '</div></div>');
    });*/
            var res=[];
            $(result).find("return").each(function () {
                   res.push( $(this).text()) ;
            });
            alert(res[0]);
}

function Authorization(){
        var name=document.getElementById("login").value;
        var password=document.getElementById("password").value;
        var msg='<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">'+
        '<S:Header/>'+
        '<S:Body>'+
            '<ns2:authorization xmlns:ns2="http://WebServiceStub.com/">'+
                '<name>'+ name+'</name>'+
                '<passworld>'+ password+'</passworld>'+
           '</ns2:authorization>'+
        '</S:Body>'+
        '</S:Envelope>';
        $.ajax({
        url:"http://localhost:8080/WebServiceStub/WebServiceStub",
        type: "POST",
        dataType: "xml",
        data: msg,
        contentType: 'text/xml; charset="utf-8"',
        success:function(result){
            OnSucsessAuthorization(result);
              //alert( $(result).find("return").text());
        },
         error: function(){alert("Error: Something went wrong");}									 
	});

}
  function  OnSucsessAuthorization(result){
       result =$(result).find("return").text();
       if (result!=-1) {
           $(".alert-error").hide();
           $(".content").show();}
  }
  
  function getArray(){
        var name=document.getElementById("login").value;
        var password=document.getElementById("password").value;
        var msg='<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">'+
                '<S:Header/>'+
                '<S:Body>'+
                    '<ns2:getArrayOfString xmlns:ns2="http://WebServiceStub.com/"/>'+
                '</S:Body>'+
            '</S:Envelope>';
        $.ajax({
        url:"http://localhost:8080/WebServiceStub/WebServiceStub",
        type: "POST",
        dataType: "xml",
        data: msg,
        contentType: 'text/xml; charset="utf-8"',
        success:function(result){
            OnSucsessGetArray(result);
              //alert( $(result).find("return").text());
        },
         error: function(){alert("Error: Something went wrong");}									 
	});

}
  function  OnSucsessGetArray(result){
        var res=[];
         $(result).find("return").each(function () {
                res.push( $(this).text()) ;
         })
         alert(res[0]+res[1]);
  }
  
